Can't open target of outlink (when source and target are baselines)

I am processing outlinks from within a baselined module (part of a baseline set).

In DOORS when I right click the outlink I see two kinds of targets:

- normal looking outlinks, e.g. /Some/module/path [14.0 (baseline set description)] > 1427: The widget shal...

- outlinks inside brackets, e.g. /Some/other/module/path > (1293: The widget speed shall...)

The normal looking outlinks (without the brackets) are associated with baselined modules in the same baseline set as the current module.

What are the brackets supposed to denote? (Just the lack of a baseline set name at the end of the module already tells me it is not a baselined module.)

 

However my main question is this:

My script can't find the target objects for links to the baselined modules: see code below (sorry: forum's <> code insert function is not working today for me: added as regular text.)

For links to baseline modules I hit the errorBox line and halt.

Yet if I open the baselined target module first (manually right click the out arrow and select the baselined target object using the normal DOORS interface), then of course the script works.

How do I get the script to open the target module if it is not already open and it is a baselined module?

 

for outLink in all (o) -> "*" do 
{
    oTarget=target(outLink)
    if (null oTarget)
    {
        targetMod=target(outLink)
        read(fullName(targetMod),false)
        oTarget=target(outLink)  
        if (null oTarget) {errorBox "FAILURE FINDING TARGET OBJECT!"; halt}
    }
     //...do processing of target object here
}

 

 

 

 

 


strathglass - Fri Jun 24 09:22:42 EDT 2016

Re: Can't open target of outlink (when source and target are baselines)
strathglass - Fri Jun 24 09:38:37 EDT 2016

OK, did some more testing and this seems to work...does this look correct?

 

for outLink in all (o) -> "*" do 
{
    oTarget=target(outLink)
    if (null oTarget)
    {
        targetMod=target(outLink)
        read(fullName(targetMod),false)
        oTarget=target(outLink)  
        if (null oTarget && isBaseline(module(o)) {errorBox "FAILURE FINDING TARGET OBJECT!"; halt} //not sure the added green bit on this line is strictly necessary
        {
            //handle case where we have a versioned link to follow:
            targetModVer=targetVersion(outLink)
            load(targetModVer,false)
            oTarget=target(outLink)
        }

    }
     //...do processing of target object here
}